/**
 * 
 */
package truerefactor.graph;

/**
 * StatementType - Enumeration containing constants representing different types
 * of statements possible for most OOP languages. Once a more general parser is
 * developed this may need to either be redefined or removed.
 * 
 * @author Isaac Griffith
 */
public enum StatementType {

    /**
     * Represents the starting node of an if type subgraph of a MethodNode's
     * statement graph
     */
    IF("if"),
    /**
     * Represents the starting node of a while type subgraph of a MethodNode's
     * statement graph
     */
    WHILE("while"),
    /**
     * Represents the starting node of a do while type subgraph of a
     * MethodNode's statement graph
     */
    DO_WHILE("do"),
    /**
     * Represents the starting node of a block type subgraph of a MethodNode's
     * statement graph
     */
    BLOCK("block"),
    /**
     * Represents the starting node of a try type subgraph of a MethodNode's
     * statement graph
     */
    TRY("try"),
    /**
     * Represents the starting node of a catch type subgraph of a MethodNode's
     * statement graph
     */
    CATCH("catch"),
    /**
     * Represents a throw type statement of a MethodNode's statement graph
     */
    THROW("throw"),
    /**
     * Represents the starting node of a synchronized type subgraph of a
     * MethodNode's statement graph
     */
    SYNCHRONIZED("syncrhonized"),
    /**
     * Represents the starting node of a switch type subgraph of a MethodNode's
     * statement graph
     */
    SWITCH("switch"),
    /**
     * Represents the starting node of a case type subgraph of a MethodNode's
     * statement graph
     */
    CASE("case"),
    /**
     * Represents a return statement in a MethodNode's statement graph
     */
    RETURN("return"),
    /**
     * Represents the starting node of an for type subgraph of a MethodNode's
     * statement graph
     */
    FOR("for"),
    /**
     * Represents the starting node of an if type subgraph of a MethodNode's
     * statement graph
     */
    EXPRESSION("expression"),
    /**
     * Represents a single expression within a MethodNode's subgraph
     */
    TYPE_DECLARATION("type"),
    /**
     * Represents a node used to create a junction point but has no real
     * representation within code
     */
    NULL_TYPE("");

    /**
     * A stored string representation of this type to be used when building the
     * StatementGraph
     */
    private String identifier;

    /**
     * Constructs a new StatementType enumeration constant with the provided
     * string literal as a identifier to be used in construction of the
     * StatementGraphs
     * 
     * @param identifier
     *            String literal to better represent this type
     */
    private StatementType(String identifier)
    {
        this.identifier = identifier;
    }

    /**
     * @return the string associated with this StatementType
     */
    public String getIdentifier()
    {
        return identifier;
    }
}
